package com.situ.mall.pattern.jdkobserver;

import java.util.Observable;

public class NewsPaper extends Observable {
    //报纸内容
    private String content;

    public void setContent(String content) {
        this.content = content;
        //使用Java的Observer模式时候，这句话不能少
        this.setChanged();
        //this.notifyObservers();
        this.notifyObservers(content);
    }

    public String getContent() {
        return content;
    }
}
